<template>
  <div>
    <el-form :inline="true" :model="query" class="demo-form-inline">
      <el-form-item label="关键字">
        <el-input v-model="query.keyword" placeholder="关键字"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="initPageData">查询</el-button>
      </el-form-item>
    </el-form>
  <el-table
    :data="kq.data"
    border
    style="width: 100%"
    stripe>
    <el-table-column
      type="selection"
      width="55">
    </el-table-column>
    <el-table-column
      prop="id"
      label="ID"
      width="100">
    </el-table-column>
    <el-table-column
      prop="note_content"
      label="记录类容"
      width="200">
    </el-table-column>
    <el-table-column
      prop="create_time"
      label="创建时间"
      width="200">
    </el-table-column>
    <el-table-column
        prop="create_by"
        label="创建人"
        width="200">
    </el-table-column>
    <el-table-column
        prop="edit_time"
        label="修改时间"
        width="200">
    </el-table-column>
    <el-table-column
      prop="edit_by"
      label="修改人"
      width="200">
    </el-table-column>
  </el-table>
  <el-pagination
    background
    @size-change="handleSizeChange"
    @current-change="currentChangeFunc"
    :current-page="query.currentPage"
    :page-size="query.pageNumber"
    :page-sizes="[10, 20, 50]"
    layout="total, sizes, prev, pager, next, jumper"
    :total=kq.total>
  </el-pagination>
  </div>
</template>

<script>
export default {
  data() {
    return {
      kq: {
        data:null,
        total:null
      },
      query:{
        currentPage:1,
        pageNumber:10,
        keyword:"",
      }
    }

  },
  methods:{
    handleSizeChange(val){
      this.query.pageNumber=val;
      this.query.currentPage = 1;
      this.initPageData();
    },
    currentChangeFunc(val){
      this.query.currentPage=val;
      this.initPageData();
    },
    initPageData(){
      this.$http.post("/activityRemark",this.query)
        .then(result=>{
          this.query.keyword=""
          let pageData = result.data;
         this.kq=pageData.object;
         debugger
        }).catch(result=>{
          alert(result.message)
      })
    }
  },
  mounted() {
    this.initPageData()
  }
}
</script>
